package com.tianchi.lexiang.constant;

public class Commands {
	public static final String CMD_TYPE = "cmd_type";
	public static final String CMD_COTENT = "cmd_cotent";
	
	public static final int CMD_DB_TYPE = 1000;
	public static final int CMD_DB_TOP = CMD_DB_TYPE + 1;
	public static final int CMD_DB_DELETE = CMD_DB_TYPE + 2;
	public static final int CMD_DB_ADD = CMD_DB_TYPE + 3;
	public static final int CMD_DB_PRIORITY = CMD_DB_TYPE + 4;
	
	public static final int CMD_VIDEO_TYPE = 1100;
	public static final int VIDEO_LOOP = CMD_VIDEO_TYPE + 1;
	public static final int VIDEO_NEXT = CMD_VIDEO_TYPE + 2;
	public static final int VIDEO_START = CMD_VIDEO_TYPE + 3;
	public static final int VIDEO_PAUSE = CMD_VIDEO_TYPE + 4;
	
	public static final int CMD_VOLUME_TYPE = 1200;
	public static final int VOLUME_VALUE = CMD_VOLUME_TYPE + 1;
	
	public static final int CMD_ORIGINAL_TYPE = 1300;
	public static final int ORIGINAL = CMD_ORIGINAL_TYPE + 1;
	public static final int ACCOMPANY = CMD_ORIGINAL_TYPE + 2;
	
	public static final int CMD_RESPONSE = 1400;
	public static final int ERROR = CMD_RESPONSE + 1;
	public static final int SUCCESS = CMD_RESPONSE + 2;
	
	public static final int CMD_QUERY_VERSION = 1500;
	
	public static final int CMD_SYNC_DB = 1600;
	public static final int CMD_SYNC_TABLE_ALREADYPOINT = CMD_SYNC_DB + 1;
	public static final int CMD_SYNC_TABLE_OSD = CMD_SYNC_DB + 2;
	public static final int CMD_SYNC_TABLE_PUBLIC_SONG = CMD_SYNC_DB + 3;
	public static final int CMD_SYNC_DB_START = CMD_SYNC_DB + 4;
	public static final int CMD_SYNC_DB_END = CMD_SYNC_DB + 5;
	
	public static final int CMD_HEART = 1700;
	public static final int CMD_HEART_RESONSE = CMD_HEART + 1;
	
	public static final int CMD_BACKGROUND = 1800;
	public static final int CMD_BACKGROUND_LOGIN_SUCCESS = CMD_BACKGROUND + 1;
	public static final int CMD_BACKGROUND_LOGIN_FAIL = CMD_BACKGROUND + 2;
	
	public static final int CMD_RESET_PWD = 1900;
	public static final int CMD_RESET_PWD_SUCCESS = CMD_RESET_PWD + 1;
	public static final int CMD_RESET_PWD_FAIL = CMD_RESET_PWD + 2;
	
	public static final int CMD_SCREEN_TYPE = 2000;
	public static final int CMD_SCREEN_TYPE_VGA_AV = CMD_SCREEN_TYPE + 1;
	public static final int CMD_SCREEN_TYPE_VGA_HDMI = CMD_SCREEN_TYPE + 2;
	
	private long cmdSerialId;
	private String cmdType;
	private String cmdContent;
	
	public Commands(String cmdType, String cmdContent) {
		super();
		cmdSerialId++;
		this.cmdType = cmdType;
		this.cmdContent = cmdContent;
	}
	
	public Commands(int cmdType, int cmdContent) {
		super();
		cmdSerialId++;
		this.cmdType = String.valueOf(cmdType);
		this.cmdContent = String.valueOf(cmdContent);
	}
	
	public Commands(int cmdType, String cmdContent) {
		super();
		cmdSerialId++;
		this.cmdType = String.valueOf(cmdType);
		this.cmdContent = cmdContent;
	}
	
	public Commands(String cmdType, int cmdContent) {
		super();
		cmdSerialId++;
		this.cmdType = cmdType;
		this.cmdContent = String.valueOf(cmdContent);
	}
	
	public String getCmdType() {
		return cmdType;
	}
	
	public void setCmdType(String cmdType) {
		this.cmdType = cmdType;
	}
	
	public String getCmdContent() {
		return cmdContent;
	}
	
	public void setCmdContent(String cmdContent) {
		this.cmdContent = cmdContent;
	}
	
	public long getCmdSerialId() {
		return cmdSerialId;
	}
	
	public String translateToDetailCmd(){
		return CMD_TYPE + "=" + cmdType + "\r\n" +
				CMD_COTENT + "=" + cmdContent + "\r\n";
	}
	
	@Override
	public String toString() {
		return "Commands [cmdSerialId=" + cmdSerialId + ", cmdType=" + cmdType
				+ ", cmdContent=" + cmdContent + "]";
	}
}
